package lhdx3;

import java.util.Scanner;

public class Xsczyin {

        public static void main(String[] args) {
            Scanner in=new Scanner(System.in);
            Xscz java78=new Xscz();
            java78.name="牛x的java78";
            java78.dirTeacher="Old Liu";
            int choice=0;
            while (true){
                System.out.println("1:加新生,2:查看信息，4：按照范围查找，8：退出");
                choice=in.nextInt();
                if(choice==1){
                    System.out.print("请输入新生的姓名：");
                    String sname=in.next();
                    java78.add(sname);
                }else if(choice==2){
                    java78.showInformation();
                }else if(choice==4){ System.out.print("找谁：");
                    String name=in.next();
                    boolean exists=java78.searchName(name);
                    if(exists){
                        System.out.println(name+"在这个班");
                    }else{
                        System.out.println(name+"不在这个班");
                    }
                }else if(choice==8){
                    break;
                }
            }
        }
    }

